Skip to content

feat(adrc): Add Active Disturbance Rejection Control (ADRC) component#627

Merged
finger563 merged 7 commits into
mainfrom
feat/adrc
Jun 3, 2026
Merged

feat(adrc): Add Active Disturbance Rejection Control (ADRC) component#627
finger563 merged 7 commits into
mainfrom
feat/adrc

Conversation

@finger563
Copy link
Copy Markdown
Contributor

@finger563 finger563 commented May 30, 2026

Description

  • Add Active Disturbance Rejection Control (ADRC) component

Motivation and Context

ADRC is an alternative linear and nonlinear model-free control for systems, to be used alongside of or as a replacement to PID. Target applications might be motor or trajectory control of a robot.

How has this been tested?

Build and run adrc/example on a QtPy ESP32s3

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

I (312) main_task: Calling app_main()
ADRC example
Linear first-order ADRC example
t=0.00s ref=0.00 y=0.000 u=0.000 z2=0.000
t=0.10s ref=0.00 y=0.000 u=0.000 z2=0.000
t=0.20s ref=0.00 y=0.000 u=0.000 z2=0.000
t=0.30s ref=1.00 y=0.198 u=4.000 z2=0.002
t=0.40s ref=1.00 y=0.552 u=3.851 z2=-0.325
t=0.50s ref=1.00 y=0.776 u=2.459 z2=-0.707
t=0.60s ref=1.00 y=0.886 u=1.834 z2=-0.945
t=0.70s ref=1.00 y=0.942 u=1.523 z2=-1.070
t=0.80s ref=1.00 y=0.970 u=1.365 z2=-1.133
t=0.90s ref=1.00 y=0.985 u=1.284 z2=-1.166
t=1.00s ref=1.00 y=0.992 u=1.243 z2=-1.183
t=1.10s ref=1.00 y=0.996 u=1.222 z2=-1.191
t=1.20s ref=1.00 y=0.998 u=1.211 z2=-1.196
t=1.30s ref=1.00 y=0.999 u=1.206 z2=-1.198
t=1.40s ref=1.00 y=0.999 u=1.203 z2=-1.199
t=1.50s ref=1.00 y=1.000 u=1.201 z2=-1.199
t=1.60s ref=1.00 y=1.000 u=1.201 z2=-1.200
t=1.70s ref=1.00 y=1.000 u=1.200 z2=-1.200
t=1.80s ref=1.00 y=1.000 u=1.200 z2=-1.200
t=1.90s ref=1.00 y=1.000 u=1.200 z2=-1.200
t=2.00s ref=1.00 y=1.000 u=1.200 z2=-1.200
t=2.10s ref=1.00 y=1.000 u=1.200 z2=-1.200
t=2.20s ref=1.00 y=1.000 u=1.200 z2=-1.200
t=2.30s ref=1.00 y=1.000 u=1.200 z2=-1.200
t=2.40s ref=1.00 y=1.000 u=1.200 z2=-1.200
t=2.50s ref=1.00 y=0.999 u=1.200 z2=-1.200
t=2.60s ref=1.00 y=0.963 u=1.978 z2=-1.732
t=2.70s ref=1.00 y=0.975 u=2.114 z2=-1.924
t=2.80s ref=1.00 y=0.987 u=2.072 z2=-1.969
t=2.90s ref=1.00 y=0.993 u=2.038 z2=-1.985
t=3.00s ref=1.00 y=0.997 u=2.019 z2=-1.992
t=3.10s ref=1.00 y=0.998 u=2.010 z2=-1.996
t=3.20s ref=1.00 y=0.999 u=2.005 z2=-1.998
t=3.30s ref=1.00 y=1.000 u=2.003 z2=-1.999
t=3.40s ref=1.00 y=1.000 u=2.001 z2=-1.999
t=3.50s ref=1.00 y=1.000 u=2.001 z2=-2.000
t=3.60s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=3.70s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=3.80s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=3.90s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.00s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.10s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.20s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.30s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.40s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.50s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.60s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.70s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.80s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=4.90s ref=1.00 y=1.000 u=2.000 z2=-2.000
t=5.00s ref=1.00 y=1.000 u=2.000 z2=-2.000
Linear second-order ADRC example
t=0.00s ref=0.00 y=0.000 u=0.000 z3=0.000
t=0.10s ref=0.00 y=0.000 u=0.000 z3=0.000
t=0.20s ref=0.00 y=0.000 u=0.000 z3=0.000
t=0.30s ref=1.00 y=0.010 u=8.000 z3=-0.034
t=0.40s ref=1.00 y=0.076 u=8.000 z3=-1.794
t=0.50s ref=1.00 y=0.185 u=8.000 z3=-4.208
t=0.60s ref=1.00 y=0.313 u=8.000 z3=-6.407
t=0.70s ref=1.00 y=0.442 u=8.000 z3=-8.180
t=0.80s ref=1.00 y=0.558 u=8.000 z3=-9.457
t=0.90s ref=1.00 y=0.653 u=8.000 z3=-10.237
t=1.00s ref=1.00 y=0.722 u=8.000 z3=-10.574
t=1.10s ref=1.00 y=0.766 u=8.000 z3=-10.552
t=1.20s ref=1.00 y=0.786 u=8.000 z3=-10.270
t=1.30s ref=1.00 y=0.786 u=8.000 z3=-9.827
t=1.40s ref=1.00 y=0.773 u=8.000 z3=-9.313
t=1.50s ref=1.00 y=0.751 u=8.000 z3=-8.801
t=1.60s ref=1.00 y=0.724 u=8.000 z3=-8.344
t=1.70s ref=1.00 y=0.698 u=8.000 z3=-7.974
t=1.80s ref=1.00 y=0.673 u=8.000 z3=-7.707
t=1.90s ref=1.00 y=0.654 u=8.000 z3=-7.542
t=2.00s ref=1.00 y=0.639 u=8.000 z3=-7.469
t=2.10s ref=1.00 y=0.630 u=8.000 z3=-7.472
t=2.20s ref=1.00 y=0.626 u=8.000 z3=-7.528
t=2.30s ref=1.00 y=0.625 u=8.000 z3=-7.619
t=2.40s ref=1.00 y=0.628 u=8.000 z3=-7.725
t=2.50s ref=1.00 y=0.633 u=8.000 z3=-7.831
t=2.60s ref=1.00 y=0.644 u=8.000 z3=-7.189
t=2.70s ref=1.00 y=0.663 u=8.000 z3=-7.282
t=2.80s ref=1.00 y=0.686 u=8.000 z3=-7.663
t=2.90s ref=1.00 y=0.710 u=8.000 z3=-7.997
t=3.00s ref=1.00 y=0.731 u=8.000 z3=-8.242
t=3.10s ref=1.00 y=0.749 u=8.000 z3=-8.395
t=3.20s ref=1.00 y=0.762 u=8.000 z3=-8.466
t=3.30s ref=1.00 y=0.771 u=8.000 z3=-8.470
t=3.40s ref=1.00 y=0.775 u=8.000 z3=-8.423
t=3.50s ref=1.00 y=0.776 u=8.000 z3=-8.345
t=3.60s ref=1.00 y=0.773 u=8.000 z3=-8.252
t=3.70s ref=1.00 y=0.769 u=8.000 z3=-8.158
t=3.80s ref=1.00 y=0.765 u=8.000 z3=-8.073
t=3.90s ref=1.00 y=0.760 u=8.000 z3=-8.003
t=4.00s ref=1.00 y=0.755 u=8.000 z3=-7.952
t=4.10s ref=1.00 y=0.752 u=8.000 z3=-7.919
t=4.20s ref=1.00 y=0.749 u=8.000 z3=-7.904
t=4.30s ref=1.00 y=0.747 u=8.000 z3=-7.903
t=4.40s ref=1.00 y=0.746 u=8.000 z3=-7.912
t=4.50s ref=1.00 y=0.746 u=8.000 z3=-7.928
t=4.60s ref=1.00 y=0.746 u=8.000 z3=-7.947
t=4.70s ref=1.00 y=0.747 u=8.000 z3=-7.967
t=4.80s ref=1.00 y=0.748 u=8.000 z3=-7.984
t=4.90s ref=1.00 y=0.749 u=8.000 z3=-7.999
t=5.00s ref=1.00 y=0.750 u=8.000 z3=-8.010
Han first-order ADRC example
t=0.00s ref=0.00 td=0.000 y=0.000 u=0.000
t=0.10s ref=0.00 td=0.000 y=0.000 u=0.000
t=0.20s ref=0.00 td=0.000 y=0.000 u=0.000
t=0.30s ref=1.00 td=0.057 y=0.012 u=0.581
t=0.40s ref=1.00 td=0.509 y=0.176 u=3.048
t=0.50s ref=1.00 td=0.943 y=0.515 u=4.000
t=0.60s ref=1.00 td=1.000 y=0.793 u=2.930
t=0.70s ref=1.00 td=1.000 y=0.928 u=1.964
t=0.80s ref=1.00 td=1.000 y=0.981 u=1.469
t=0.90s ref=1.00 td=1.000 y=0.997 u=1.256
t=1.00s ref=1.00 td=1.000 y=0.999 u=1.210
t=1.10s ref=1.00 td=1.000 y=1.000 u=1.202
t=1.20s ref=1.00 td=1.000 y=1.000 u=1.200
t=1.30s ref=1.00 td=1.000 y=1.000 u=1.200
t=1.40s ref=1.00 td=1.000 y=1.000 u=1.200
t=1.50s ref=1.00 td=1.000 y=1.000 u=1.200
t=1.60s ref=1.00 td=1.000 y=1.000 u=1.200
t=1.70s ref=1.00 td=1.000 y=1.000 u=1.200
t=1.80s ref=1.00 td=1.000 y=1.000 u=1.200
t=1.90s ref=1.00 td=1.000 y=1.000 u=1.200
t=2.00s ref=1.00 td=1.000 y=1.000 u=1.200
t=2.10s ref=1.00 td=1.000 y=1.000 u=1.200
t=2.20s ref=1.00 td=1.000 y=1.000 u=1.200
t=2.30s ref=1.00 td=1.000 y=1.000 u=1.200
t=2.40s ref=1.00 td=1.000 y=1.000 u=1.200
t=2.50s ref=1.00 td=1.000 y=0.999 u=1.200
t=2.60s ref=1.00 td=1.000 y=0.999 u=1.932
t=2.70s ref=1.00 td=1.000 y=1.000 u=1.996
t=2.80s ref=1.00 td=1.000 y=1.000 u=2.000
t=2.90s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.00s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.10s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.20s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.30s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.40s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.50s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.60s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.70s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.80s ref=1.00 td=1.000 y=1.000 u=2.000
t=3.90s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.00s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.10s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.20s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.30s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.40s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.50s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.60s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.70s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.80s ref=1.00 td=1.000 y=1.000 u=2.000
t=4.90s ref=1.00 td=1.000 y=1.000 u=2.000
t=5.00s ref=1.00 td=1.000 y=1.000 u=2.000
Han second-order ADRC example
t=0.00s ref=0.00 td=0.000 y=0.000 u=0.000 z3=0.000
t=0.10s ref=0.00 td=0.000 y=0.000 u=0.000 z3=0.000
t=0.20s ref=0.00 td=0.000 y=0.000 u=0.000 z3=0.000
t=0.30s ref=1.00 td=0.076 y=0.006 u=8.000 z3=-0.467
t=0.40s ref=1.00 td=0.649 y=0.066 u=8.000 z3=-2.803
t=0.50s ref=1.00 td=0.995 y=0.171 u=8.000 z3=-5.201
t=0.60s ref=1.00 td=1.000 y=0.298 u=8.000 z3=-7.251
t=0.70s ref=1.00 td=1.000 y=0.428 u=8.000 z3=-8.822
t=0.80s ref=1.00 td=1.000 y=0.546 u=8.000 z3=-9.883
t=0.90s ref=1.00 td=1.000 y=0.644 u=8.000 z3=-10.462
t=1.00s ref=1.00 td=1.000 y=0.716 u=8.000 z3=-10.630
t=1.10s ref=1.00 td=1.000 y=0.762 u=8.000 z3=-10.476
t=1.20s ref=1.00 td=1.000 y=0.784 u=8.000 z3=-10.106
t=1.30s ref=1.00 td=1.000 y=0.787 u=8.000 z3=-9.618
t=1.40s ref=1.00 td=1.000 y=0.775 u=8.000 z3=-9.093
t=1.50s ref=1.00 td=1.000 y=0.753 u=8.000 z3=-8.594
t=1.60s ref=1.00 td=1.000 y=0.727 u=8.000 z3=-8.168
t=1.70s ref=1.00 td=1.000 y=0.701 u=8.000 z3=-7.840
t=1.80s ref=1.00 td=1.000 y=0.676 u=8.000 z3=-7.617
t=1.90s ref=1.00 td=1.000 y=0.656 u=8.000 z3=-7.494
t=2.00s ref=1.00 td=1.000 y=0.641 u=8.000 z3=-7.458
t=2.10s ref=1.00 td=1.000 y=0.631 u=8.000 z3=-7.486
t=2.20s ref=1.00 td=1.000 y=0.626 u=8.000 z3=-7.561
t=2.30s ref=1.00 td=1.000 y=0.625 u=8.000 z3=-7.662
t=2.40s ref=1.00 td=1.000 y=0.628 u=8.000 z3=-7.771
t=2.50s ref=1.00 td=1.000 y=0.632 u=8.000 z3=-7.873
t=2.60s ref=1.00 td=1.000 y=0.643 u=8.000 z3=-7.016
t=2.70s ref=1.00 td=1.000 y=0.662 u=8.000 z3=-7.483
t=2.80s ref=1.00 td=1.000 y=0.685 u=8.000 z3=-7.857
t=2.90s ref=1.00 td=1.000 y=0.709 u=8.000 z3=-8.145
t=3.00s ref=1.00 td=1.000 y=0.731 u=8.000 z3=-8.342
t=3.10s ref=1.00 td=1.000 y=0.749 u=8.000 z3=-8.450
t=3.20s ref=1.00 td=1.000 y=0.762 u=8.000 z3=-8.483
t=3.30s ref=1.00 td=1.000 y=0.771 u=8.000 z3=-8.455
t=3.40s ref=1.00 td=1.000 y=0.775 u=8.000 z3=-8.388
t=3.50s ref=1.00 td=1.000 y=0.776 u=8.000 z3=-8.299
t=3.60s ref=1.00 td=1.000 y=0.773 u=8.000 z3=-8.203
t=3.70s ref=1.00 td=1.000 y=0.770 u=8.000 z3=-8.111
t=3.80s ref=1.00 td=1.000 y=0.765 u=8.000 z3=-8.033
t=3.90s ref=1.00 td=1.000 y=0.760 u=8.000 z3=-7.971
t=4.00s ref=1.00 td=1.000 y=0.755 u=8.000 z3=-7.931
t=4.10s ref=1.00 td=1.000 y=0.752 u=8.000 z3=-7.907
t=4.20s ref=1.00 td=1.000 y=0.749 u=8.000 z3=-7.900
t=4.30s ref=1.00 td=1.000 y=0.747 u=8.000 z3=-7.906
t=4.40s ref=1.00 td=1.000 y=0.746 u=8.000 z3=-7.919
t=4.50s ref=1.00 td=1.000 y=0.746 u=8.000 z3=-7.938
t=4.60s ref=1.00 td=1.000 y=0.746 u=8.000 z3=-7.957
t=4.70s ref=1.00 td=1.000 y=0.747 u=8.000 z3=-7.977
t=4.80s ref=1.00 td=1.000 y=0.748 u=8.000 z3=-7.993
t=4.90s ref=1.00 td=1.000 y=0.749 u=8.000 z3=-8.005
t=5.00s ref=1.00 td=1.000 y=0.750 u=8.000 z3=-8.016
ADRC example complete!

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

Copilot AI review requested due to automatic review settings May 30, 2026 20:42
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 30, 2026

✅Static analysis result - no issues found! ✅

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new adrc component providing Active Disturbance Rejection Control utilities: a Han tracking differentiator and four ADRC controllers (linear and Han nonlinear, first- and second-order), together with an example application and the corresponding documentation and CI wiring.

Changes:

  • New components/adrc component (header-only logic in adrc.hpp plus stub .cpp, CMake, manifest, README, example).
  • Documentation added: doc/en/adrc.rst, doc/en/adrc_example.md, Doxyfile entries, and index entry.
  • CI wiring: build.yml matrix entry and upload_components.yml upload entry.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
components/adrc/include/adrc.hpp Core ADRC classes (TD + 4 controllers)
components/adrc/src/adrc.cpp Empty translation unit including the header
components/adrc/CMakeLists.txt Component registration requiring base_component
components/adrc/idf_component.yml IDF component manifest
components/adrc/README.md Component-level overview
components/adrc/example/CMakeLists.txt Example project cmake
components/adrc/example/README.md Example overview
components/adrc/example/main/CMakeLists.txt Example main component registration
components/adrc/example/main/adrc_example.cpp Simulated plants exercising all 4 controllers
doc/Doxyfile Adds adrc header and example to Doxygen INPUT/EXAMPLE_PATH
doc/en/index.rst Adds adrc entry to docs toctree
doc/en/adrc.rst Long-form ADRC documentation and tuning guide
doc/en/adrc_example.md Includes the example README
.github/workflows/build.yml Adds ADRC example to CI matrix (esp32)
.github/workflows/upload_components.yml Adds ADRC to component upload list

Comment thread components/adrc/include/adrc.hpp Outdated
Comment thread components/adrc/include/adrc.hpp
Comment thread components/adrc/include/adrc.hpp Outdated
@finger563 finger563 self-assigned this May 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Comment thread components/adrc/example/main/adrc_example.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Comment thread components/adrc/include/adrc.hpp Outdated
Comment thread components/adrc/include/adrc.hpp Outdated
Comment thread components/adrc/include/adrc.hpp Outdated
Comment thread components/adrc/include/adrc.hpp Outdated
Comment thread components/adrc/include/adrc.hpp Outdated
Comment thread components/adrc/example/CMakeLists.txt
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Comment thread components/adrc/include/adrc.hpp
Comment thread components/adrc/include/adrc.hpp
Comment thread components/adrc/include/adrc.hpp
Comment thread components/adrc/include/adrc.hpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

@finger563 finger563 merged commit 5d8f7f3 into main Jun 3, 2026
109 of 110 checks passed
@finger563 finger563 deleted the feat/adrc branch June 3, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants